/**
 * 去除输入框两端的空格
 */
let data = {
	phone: this.phone,
	password: this.pass.replace(/(^\s*)|(\s*$)/g, "")
}

/**
 * uniapp
 * 电话输入框
 */
<input type="number" v-model="phone" placeholder="请输入电话号码" maxlength="11" confirm-type="done"></input>

/**
 * uniapp 
 * 密码输入框
 */
<input type="text" v-model="pass" :password="true" placeholder="请输入密码" maxlength="50" bindconfirm="toLogin" confirm-type="none"></input>,

/**
 * 手机号校验
 */
let isPhone = this.isPoneAvailable(this.phone)
if (!isPhone) {
	uni.showToast({
		title: '请输入有效的手机号',
		mask: true
	})
	this.loginFlag = true;
	return;
}

// 判断是否为手机号
isPoneAvailable: function(phone) {
	let myreg = /^[1][3,4,5,7,8][0-9]{9}$/;
	if (!myreg.test(phone)) {
		return false;
	} else {
		return true;
	}
},

/**
 * 时间相关的
 */
/**
 * 将时间转换为日期
 */
timestampToTime(timestamp) {
	// console.log('timestamp', timestamp)
	var date = new Date(timestamp * 1000);//时间戳为10位需*1000，时间戳为13位的话不需乘1000
	// console.log('time ', date)
	 var Y = date.getFullYear() + '-';
	var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
	var D = date.getDate() + ' ';
	var h = date.getHours() + ':';
	var m = date.getMinutes() + ':';
	 var s = date.getSeconds();
	 return Y+M+D+h+m+s;
},

/**
 * 按钮按下的效果
 */
<view class="sure" @touchstart="sureDown" @touchend="sureUp" :style="{opacity: bgcolor}">
	保存
</view>
data() {
	return {
		bgcolor: 1
	}
}
/**
 * 按下
 */
sureDown(){
	this.bgcolor = '.6'
},
sureUp(){
	this.bgcolor = '1'
}

/**
 * 板块 淡进
 */
<view class="check_ul"  :style="{height: index==mark?'auto': 0, opacity: index==mark?'1': '0', transform: index==mark?'translateY(0px)':'translateY(30px)'}">,
...
</view>
.check_ul{
	// min-height: 500rpx;
	border-radius: 20rpx;
	background-color: #F8F8FA;
			
	height: 0;
	overflow: hidden;
	transition: all .3s ease-out;
	transform: translateY(30px);
}
.check_ul_on{
	height: 'auto';
}

/**
 * switch 开关
 */
<view class="switch_box" @tap="tapSwitch(index)">
	<view class="is_switch" :class="item.wIsProject==1?'is_switch_on':''">
		<view class="switch_dot" :class="item.wIsProject==1?'switch_dot_on':''">
								
		</view>
	</view>
</
.switch_box{
	width: 100%;
	height: 100%;
	.is_switch{
		width: 60rpx;
		height: 30rpx;
		border-radius: 15rpx;
		border: 2px solid #dcdcdc;
		box-sizing: border-box;
		background-color: #fff;
		transition: all .1s linear;
		.switch_dot{
			width: 25rpx;
			height: 25rpx;
			border-radius: 50%;
			border: 1px solid #dcdcdc;
			background-color: #fff;
			box-sizing: border-box;
			transition: all .2s linear;
		}
		.switch_dot_on{
			transform: translateX(32rpx);
			transform: rotate3d(660deg);
		}
	}
	.is_switch_on{
		background-color: #2B8CF9;
	}
}
